import Vue from  "vue"
import VueRouter from "vue-router";
Vue.use(VueRouter)
//导入组件
import Login from "@/views/Login.vue";
import Home from "@/views/Home.vue";
//
import desk1 from "@/views/desk/desk1.vue";
import desk2 from "@/views/desk/desk2.vue";
import desk3 from "@/views/desk/desk3.vue";
import desk2v1 from "@/views/desk/desk2-1.vue";
import People from "@/views/former/People.vue";
//
import Hlogin from "@/views/Hlogin.vue";
import Home1  from "@/views/Home1.vue";
import Zhuche from "@/views/Zhuche.vue";
//
import User from "@/views/former/User.vue";
import Suser from "@/views/former/Suser.vue";
//
import businesses  from "@/views/former/businesses/businesses.vue";
import businesses1 from "@/views/former/businesses/businesses1.vue";
//
import vendor from "@/views/former/vendor/vendor.vue";
import vendor1 from "@/views/former/vendor/vendor1.vue";

import Pass from "@/views/former/Pass.vue";
import ZH from "@/views/back/ZH.vue";
// 创建路由规则对象
const router=new VueRouter({
    routes:[
        {path:"/",redirect:'/Home'},
        {path:"/Home",component:Home,redirect:'/desk1',
            children:[
                {path:'/desk1',component:desk1},
                {path:'/desk2',component:desk2},
                {path:'/desk2-1/:id',component:desk2v1,props:true},
                //购物车
                {path:'/desk3',component:desk3},
                {path: '/CheckOut',name:'CheckOut',component:()=>import("@/views/former/vendor/CheckOut.vue")},
                {path: '/Payment',name:'Payment',component:()=>import("@/views/desk/Payment.vue"),
                children:[
                    //支付方式
                    {path: '/Payment1',name:'Payment1',component:()=>import("@/views/desk/Payment/Payment1.vue")},
                    {path: '/Payment2',name:'Payment2',component:()=>import("@/views/desk/Payment/Payment2.vue")},
                    {path: '/Payment3',name:'Payment3',component:()=>import("@/views/desk/Payment/Payment3.vue")}
                ]
                },
                {path: 'PaymentStatus',name:'PaymentStatus',component:()=>import("@/views/desk/PaymentStatus.vue")},
                //个人中心
                {path:"/People",component:People,redirect:'/User',
                children:[{path:'/User',component:User},
                    {path:'/Suser',component:Suser,
                        children:[
                            {path:'/Suser1',name:'Suser1',component:()=>import("@/views/former/Suser/Suser1.vue")},
                            {path:'/Suser2',name:'Suser2',component:()=>import("@/views/former/Suser/Suser2.vue")},
                            {path:'/Suser3',name:'Suser3',component:()=>import("@/views/former/Suser/Suser3.vue")},
                            {path:'/Suser4',name:'Suser4',component:()=>import("@/views/former/Suser/Suser4.vue")},
                            {path:'/SuserOne',name:'SuserOne',component:()=>import("@/views/former/Suser/SuserOne.vue")}
                        ]},
                    //商户
                    {path:'/businesses',component:businesses},
                    {path:'/businesses1',component:businesses1},
                    {path: '/businesses2',name:'businesses2',component:()=>import("@/views/former/businesses/businesses2.vue"),
                        children:[
                            //商户的不同状态的订单中心
                            {path: '/businesses2-1',name:'businesses2v1',component:()=>import("@/views/former/businesses/businesses2-1.vue")},
                            {path: '/businesses2-2',name:'businesses2v2',component:()=>import("@/views/former/businesses/businesses2-2.vue")},
                            {path: '/businesses2-3',name:'businesses2v3',component:()=>import("@/views/former/businesses/businesses2-3.vue")},
                            {path: '/businesses2-4',name:'businesses2v4',component:()=>import("@/views/former/businesses/businesses2-4.vue")},
                            {path: '/businesses2-5',name:'businesses2v5',component:()=>import("@/views/former/businesses/businesses2-5.vue")},
                            {path: '/DeskOrderOne',name:'DeskOrderOne',component:()=>import("@/views/former/businesses/DeskOrderOne.vue")}
                        ]
                    },

                    //供应商
                    {path:'/vendor',component:vendor},
                    {path:'/vendor1',component:vendor1},
                    {path: '/vendor2',name:'vendor2',component:()=>import("@/views/former/vendor/vendor2.vue")},
                    {path: '/vendor3',name:'vendor3',component:()=>import("@/views/former/vendor/vendor3.vue")},
                    {path: '/vendor3-1',name:'vendor3v1',component:()=>import("@/views/former/vendor/vendor3-1.vue")},

                    {path:'/Pass',component:Pass}
                ]
                }
            ]
        },
        {path:"/Login",component:Login},
        {path:"/Zhuche",component:Zhuche},
        {path:"/Hlogin",component:Hlogin},
        {path:"/Home1",component:Home1,redirect:'/ZH',
            children:[{path:'/ZH',component:ZH},
                {path:'/Sshenhe',name:'Sshenhe',component:()=>import("@/views/back/Sshenhe.vue")},
                {path: '/Gshenhe',name:'Gshenhe',component:()=>import("@/views/back/Gshenhe.vue")},
                {path: '/Fabu',name:'Fabu',component:()=>import("@/views/back/Fabu.vue")},
                {path: '/Caigou',name:'Caigou',component:()=>import("@/views/back/Caigou.vue")},
                {path: '/Cshenhe',name:'Cshenhe',component:()=>import("@/views/back/Cshenhe.vue")},
            ]
        },
    ]
})
// 对外共享该路由对象
export default router